package com.lds.config.center.client.autoconfigure;


import com.lds.config.center.client.listener.Annotation.DefaultItemChangeEventListenerBeanPostProcessor;
import com.lds.config.center.client.listener.Annotation.ItemChangeEventListenerBeanPostProcessor;
import com.lds.config.center.client.listener.runner.AutoAddItemChangeEventListenerRunner;
import com.lds.config.center.client.properties.ConfigCenterClientProperties;
import com.lds.config.center.client.scheduled.ClientScheduled;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(ConfigCenterClientProperties.class)
public class ConfigCenterClientAutoConfiguration {

    @Bean
    public ClientScheduled clientScheduledConfigCenterClient() {
        return new ClientScheduled();
    }

    @Bean
    public AutoAddItemChangeEventListenerRunner logItemChangeEventListenerRunnerConfigCenterClient() {
        return new AutoAddItemChangeEventListenerRunner();
    }

    @Bean
    public ItemChangeEventListenerBeanPostProcessor itemChangeEventListenerBeanPostProcessorConfigCenterClient() {
        return new ItemChangeEventListenerBeanPostProcessor();
    }

    @Bean
    public DefaultItemChangeEventListenerBeanPostProcessor defaultItemChangeEventListenerBeanPostProcessorConfigCenterClient() {
        return new DefaultItemChangeEventListenerBeanPostProcessor();
    }

}
